from django.conf.urls.defaults import patterns, include

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

import os

urlpatterns = patterns('',
    (r'^ho600_bugrecord/media/(?P<path>.*)$', 'django.views.static.serve',
        {'document_root': os.path.join(os.path.dirname(__file__), 'apps', 'ho600_bugrecord', 'media')}),
    (r'^pgpauth/media/(?P<path>.*)$', 'django.views.static.serve',
        {'document_root': os.path.join(os.path.dirname(__file__), 'apps', 'pgpauth', 'media')}),
)

urlpatterns += patterns('',
    # Example:
    # (r'^jj/', include('jj.foo.urls')),

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
    # to INSTALLED_APPS to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    (r'^ho600_bugrecord/', include('ho600_bugrecord.urls')),
    
    # Uncomment the next line to enable the admin:
    (r'^admin/(.*)$', admin.site.root),
    (r'^pgpauth/', include('pgpauth.urls')),
    (r'^$', include('pgpauth.urls'))
)

# Customize Error page
from django.conf.urls.defaults import handler404
from django.conf.urls.defaults import handler500

# original handler404 = 'django.views.defaults.page_not_found'
handler404 = 'ho600_bugrecord.views.recordHttp404Error'
# original handler500 = 'django.views.defaults.server_error'
handler500 = 'ho600_bugrecord.views.recordHttp500Error'
